{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "c38c8d81",
   "metadata": {},
   "source": [
    " | 列表的方法 | Description | 使用方法 | 备注 | \n",
    " |-----------------|---------------------|------------------|--------------| \n",
    " |append | Append object to the end of the list.|list.append(object)|注意：增加在末尾|\n",
    " |count |用于统计某个元素在列表中出现的次数 |list.count(obj) |  |\n",
    " |extend|在列表末尾一次性追加另一个序列中的多个值  |  list.extend(seq)||\n",
    " |index|  从列表中找出某个值第一个匹配项的索引位置 |list.index(x[, start[, end]])||\n",
    " |pop| 移除列表中的一个元素 |list.pop([index=-1])||\n",
    " |remove| 移除列表中某个值的第一个匹配项 |list.remove(obj)||"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "e6739636",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Don't panic!\n",
      "['D', 'o', 'n', \"'\", 't', ' ', 'p', 'a', 'n', 'i', 'c', '!']\n",
      "['o', 'n', ' ', 't', 'a', 'p']\n",
      "on tap\n"
     ]
    }
   ],
   "source": [
    "phrase = \"Don't panic!\"\n",
    "plist = list(phrase)\n",
    "print(phrase)\n",
    "print(plist)\n",
    "\n",
    "for i in range (4):\n",
    "    plist.pop()\n",
    "plist.pop(0)\n",
    "plist.remove(\"'\")\n",
    "plist.extend([plist.pop(),plist.pop()])\n",
    "plist.insert(2,plist.pop(3))\n",
    "\n",
    "new_phrase = ''.join(plist)\n",
    "print(plist)\n",
    "print(new_phrase)"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.12"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
